home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005 / CHIP Utilities 2005.iso / dosapps / mcafee / naiscrip.nsc < prev    next >
Encoding:
Text File  |  2005-01-11  |  40.5 KB  |  1,293 lines

  1. ;IMPORTANT: Network Associates provides this SuperDAT script file to 
  2. ;you "as is," without any warranty, express or implied, including but
  3. ;not limited to implied warranties of merchantability or fitness for
  4. ;a particular purpose.  You assume responsibility for using this script 
  5. ;to achieve your intented results.  Furthermore, you agree that Network
  6. ;Associates has no duty or responsibility to ensure the correct 
  7. ;operation or performance of any script file that you create, generate,
  8. ;edit, or alter for use with the SuperDAT utility software Network
  9. ;Associates provides.
  10. ;SCRIPTDESC Update DATs and engine files
  11. ;Reboot and Silent are parameters that can be called from the command
  12. ;line once the binary has been compiled.
  13. ;Scope of Variables is global
  14. ;
  15. ;--------------------- Global Variables-----------------------------
  16. ;Section name must be 'ThisPackage'. It is case sensitive.
  17. [ThisPackage]
  18. ;DatDate, DatVersion, NTDatDate, NTDatVersion, EngineVersion, 
  19. ;and NTEngineVersion variables are defined in Globals.nsg
  20. IncludeGlobals    Globals.nsg
  21. Set        FirstProductVersion=403
  22. Set        FirstGSDVersion=5.0.107.0
  23. Set     FirstVSEVersion=7.0.0.0
  24. Set     FirstPSHVersion=1.0.0.0
  25. Set     FirstGSEVersion=6.0.0.0
  26. Set     FirstSSHVersion=1.0.0.0
  27. Set        TempEngineVer=4002
  28. Set        TRUE=1
  29. Set        FALSE=0
  30. Call    InitSettings
  31.  
  32. ;--------------------- Product Checks --------------------------------
  33. ;Section name must be 'Main'. It is case sensitive.
  34. [Main]
  35. Call        FindCmdLineScanner
  36.  
  37. Call        FindVirusScan98
  38.  
  39. Call        FindVirusScanNT
  40.  
  41. Call        FindVirusScanNTSoly
  42.  
  43. Call        FindNetShieldNT
  44.  
  45. Call        FindNetShieldNTSoly
  46.             
  47. Call        FindGroupShieldExchange
  48.  
  49. Call        FindWebShieldSMTP
  50.  
  51. Call        FindVirusScan450AndLater
  52.  
  53. Call        FindNetShield450AndLater
  54.  
  55. Call        FindWebShieldSMTP450AndLater
  56.  
  57. Call        FindGroupShieldDomino
  58.  
  59. Call        FindPortalShield
  60.  
  61. Call        FindSecurityShield
  62.  
  63. ;------------------------- Read Settings from Application----------------
  64. [InitSettings]
  65. IsForceSwitchSet    bForceUpdate
  66. GetOsType        szOSType
  67.  
  68. [ValidFilterOptions]
  69. IsValidFilter    bFilter=FilterOption
  70. return        bFilter==TRUE
  71.  
  72. ;--------------------------- CmdLine Scanner ---------------------------
  73. [FindCmdLineScanner]
  74. ; --- GetScanUtilsPath looks for the appropriate command line scan binaries.
  75. ; --- It traverses through the Environment variable "PATH" to do this.
  76. ; --- Therefore, the NAI binaries will have to be somewhere within the path.
  77. Set            FilterOption = CMNDLINE_FILES
  78. ContinueIf        ValidFilterOptions
  79. GetScanUtilsPath    szDir
  80. SetWorkDir          szDir
  81. ContinueIf        4XVersionCheck
  82. SetFinalStatusFlag    bStatus = 2
  83. Call                  CmdLineDatUpdate
  84. Call                  CmdLineEngineUpdate
  85. Call            CopySdatPackFile
  86.  
  87. [CmdLineDatUpdate]
  88. ContinueIf               DatUpdateCheck
  89. SetBackupDir        szBackDir = OldDats
  90. Call                CopyDatFiles
  91.  
  92. [CmdLineEngineUpdate]
  93. ContinueIf        CmdLineEngineCheck
  94. SetBackupDir        szBackDir = OldEng
  95. Call            CopyCommandLineFiles
  96. Call            EngineDats
  97.  
  98. [CmdLineEngineCheck]
  99. Call            ScanOlderCheck
  100. IsCurrentFileOlder    bOlderScanPM = SCANPM.EXE
  101. return            bOlderScan == TRUE | bOlderScanPM == TRUE | bForceUpdate == TRUE
  102.  
  103. [ScanOlderCheck]
  104. FileExists        bFound = SCAN.EXE
  105. Set            bOlderScan = FALSE
  106. ContinueIf        FoundCheck
  107. IsCurrentFileOlder    bOlderScan = SCAN.EXE
  108.  
  109.  
  110. ;--------------------- VirusScan 98 --------------------------------
  111. [FindVirusScan98]
  112. ContinueIf        PlatformWin32_9XCheck
  113. ContinueIf        ProcessorX86_Check
  114. Set            FilterOption = WIN9X_FILES
  115. ContinueIf        ValidFilterOptions
  116. FindRegKey           HKLM\SOFTWARE\McAfee\Scan95
  117. ContinueIf        9XProd4XCheck
  118. GetRegValue          szDir = HKLM\SOFTWARE\McAfee\Scan95 , szProductLocation
  119. SetWorkDir           szDir
  120. ;Set flag to product upto date
  121. SetFinalStatusFlag    bStatus = 2
  122. Call            9XDatUpdate
  123. Call            9XEngineUpdate
  124. Call            CopySdatPackFile
  125.  
  126. [9XProd4XCheck]
  127. GetRegValue          Ver = HKLM\SOFTWARE\McAfee\Scan95 , CurrentVersionNumber 
  128. return            FirstProductVersion <= Ver  
  129.  
  130. ;--V98 Dat Section --
  131. [9XDatUpdate]
  132. ContinueIf        DatUpdateCheck
  133. SetBackupDir        szBackDir = OldDats
  134. ExtractFileSet        SCAN.DAT, NAMES.DAT, CLEAN.DAT
  135. Call            V98CloseApps
  136. Call                 CopyDatFiles
  137. InstallFiles        InterNetDAT
  138. Call                 DatCorporateRegSet
  139. SetRegValue          HKLM\SOFTWARE\McAfee\Scan95, DATFile = DatVersion
  140. Call                 Dat402AndLaterRegSet
  141. Call                UpdateCommonDATLocationRegistryValues
  142. Call            RestartV98Apps
  143.  
  144. ;--- V98 Engine Version Checking ---
  145. [9XEngineUpdate]
  146. Call            DoRegistryCheck
  147. ContinueIf        EngineUpdateCheck
  148. Call            V98ProductVersionCheck
  149.  
  150. ;----Create the key and value if not there
  151. [DoRegistryCheck]
  152. CreateRegKey        HKLM\SOFTWARE\McAfee,VirusScan
  153. ContinueIf        CheckEngineVersionValue
  154. SetRegValue          HKLM\SOFTWARE\McAfee\VirusScan, szEngineVer = TempEngineVer
  155.  
  156. [CheckEngineVersionValue]
  157. FindRegValue        bEngVer = HKLM\SOFTWARE\McAfee\VirusScan , szEngineVer
  158. return            bEngVer == FALSE
  159.  
  160. ;--- Common V98 Components ---
  161. [V98ProductVersionCheck]
  162. SetBackupDir        szBackDir = OldVXDs
  163. CanAllFilesBeCopied    szLockedFiles = SCAN.DAT
  164. GetSystemDir        szSysDir
  165. SetWorkDir           szSysDir
  166. Call            ProdV98_403
  167. Call            CopyPsapiDLL
  168. SetWorkDir           szDir 
  169. SetBackupDir        szBackDir = OldEngine
  170. Call            CopyEngineFiles
  171. Call            CopyExtraEngineFiles
  172. SetRegValue          HKLM\SOFTWARE\McAfee\VirusScan, szEngineVer = EngineVersion
  173. Call            EngRegV98CorporateSet
  174. Call            UpdateCommonEngineLocationRegistryValues
  175. Set            FilterOption = CMNDLINE_FILES
  176. ContinueIf        ValidFilterOptions
  177. InstallFiles        CommandLineSection
  178. Call            FindViruFile
  179. Call            EngineDats
  180.  
  181. ;--- Registry Assignments ---
  182.  
  183. [DatCorporateRegSet]
  184. FindRegKey        HKLM\SOFTWARE\McAfee\VirusScan
  185. SetRegValue        HKLM\SOFTWARE\McAfee\VirusScan, szVirDefDate = DatDate
  186. SetRegValue        HKLM\SOFTWARE\McAfee\VirusScan, szVirDefVer = DatVersion 
  187.  
  188. [Dat402AndLaterRegSet]
  189. FindRegKey           HKLM\SOFTWARE\Network Associates\VirusScan\CurrentVersion
  190. SetRegValue          HKLM\SOFTWARE\Network Associates\VirusScan\CurrentVersion, szDatVer = NTDatVersion
  191.  
  192. [EngRegV98CorporateSet]
  193. FindRegKey           HKLM\SOFTWARE\Network Associates\VirusScan\CurrentVersion
  194. SetRegValue          HKLM\SOFTWARE\Network Associates\VirusScan\CurrentVersion, szScanEngineVersion = EngineVersion 
  195.  
  196. [UpdateCommonDATLocationRegistryValues]
  197. FindRegKey           HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx
  198. FindRegValue        bDATVer = HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx, szVirDefVer
  199. ContinueIf            FoundVirDefVer
  200. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx, szVirDefVer=NTDatVersion
  201. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx, szVirDefDate=NTDatDate
  202.  
  203. [FoundVirDefVer]
  204. Return                bDATVer == TRUE
  205.  
  206. [UpdateCommonEngineLocationRegistryValues]
  207. FindRegKey           HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx
  208. FindRegValue        bEngineVer = HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx, szEngineVer
  209. ContinueIf            FoundEngineVer
  210. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx, szEngineVer = EngineVersion
  211.  
  212. [FoundEngineVer]
  213. Return                bEngineVer == TRUE
  214.  
  215. ;--- VirusScan9X403 ---
  216. [ProdV98_403]
  217. ContinueIf        V98_403Check
  218. InstallFiles        VXD403Section
  219.  
  220. [V98_403Check]
  221. return            Ver == 4.0.3 | Ver == 4.0.3a | Ver == 4.0.3b | Ver == 4.0.3c
  222.  
  223. ;--- Close Apps for Dat Update ---
  224. [V98CloseApps]
  225. IsAppRunning        bVShield = VshieldWin_Class
  226. IsAppRunning        bConsole = VirusScanConsoleWindowClass
  227. IsAppRunning        bWebScanX = McAfeeWebScanX
  228. CloseNaiApps        VirusScanConsoleWindowClass, NAI_VS_STAT, McAfeeWebScanX
  229. CloseNaiApps        VshieldWin_Class, VirusScan
  230.  
  231. ;--- Start Apps for Dat Update
  232. [RestartV98Apps]
  233. Call            VshwinCheck
  234. Call            WebScanxCheck
  235. Call            AvconsoleCheck
  236.  
  237. [AvconsoleCheck]
  238. ContinueIf        ConsoleWasRunning
  239. StartNaiApps        AVCONSOL.EXE
  240.  
  241. [ConsoleWasRunning]
  242. return            bConsole == TRUE
  243.  
  244. [VshwinCheck]
  245. ContinueIf        VShieldWasRunning
  246. StartNaiApps        VSHWIN32.EXE
  247.  
  248. [VShieldWasRunning]
  249. return            bVShield == TRUE
  250.  
  251. [WebScanxCheck]
  252. ContinueIf        WebScanXWasRunning
  253. StartNaiApps        WEBSCANX.EXE
  254.  
  255. [WebScanXWasRunning]
  256. return            bWebScanX == TRUE
  257.  
  258. ;-------------------------FindVirusScan450AndLater---------------------------
  259. [FindVirusScan450AndLater]
  260. ContinueIf        PlatformWin32_Check
  261. ContinueIf        ProcessorX86_Check
  262. Call            VirusScan450AndLater
  263. Call            VirusScanTC
  264. Call            FindVirusScan700AndLater
  265.  
  266. [VirusScan450AndLater]
  267. FindRegKey           HKLM\SOFTWARE\Network Associates\TVD\VirusScan
  268. GetRegValue        Ver = HKLM\SOFTWARE\Network Associates\TVD\VirusScan , szCurrentVersionNumber
  269. ContinueIf        VScanProd450Check
  270. GetRegValue        szProdDir = HKLM\SOFTWARE\Network Associates\TVD\VirusScan, szInstallDir
  271. Set            bTC = FALSE
  272. Call            CommonVirusScan450AndLater
  273.  
  274. [VirusScanTC]
  275. FindRegKey           HKLM\SOFTWARE\Network Associates\TVD\VirusScan TC
  276. GetRegValue        Ver = HKLM\SOFTWARE\Network Associates\TVD\VirusScan TC, szCurrentVersionNumber
  277. ContinueIf        VScanProd450Check
  278. GetRegValue        szProdDir = HKLM\SOFTWARE\Network Associates\TVD\VirusScan TC, szInstallDir
  279. Set            bTC = TRUE
  280. Call            CommonVirusScan450AndLater
  281.  
  282. [FindVirusScan700AndLater]
  283. ContinueIf            PlatformWin32_NTCheck
  284. LoadModule            bComponent = MCAFEEPRODUCT, {451D30D1-C1EB-4891-BD3A-5FD7E3001784}
  285. Call                VirusScanEnterprise
  286. UnloadModule        bComponent = MCAFEEPRODUCT
  287.  
  288. [VScanProd450Check]
  289. return        FirstProductVersion <= Ver
  290.  
  291. [CommonVirusScan450AndLater]
  292. ;Set flag to product upto date
  293. SetFinalStatusFlag    bStatus = 2
  294. Call            CheckAvSynchNTRunning
  295. Call            CheckAvSynch9xRunning
  296. Set            bServiceEnabled = TRUE
  297. GetRegValue        szEngDir=HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx,szInstallDir
  298. SetWorkDir        szEngDir
  299. Call            VScanDatUpdate
  300. Call            VScanEngineUpdate
  301. SetWorkDir        szProdDir
  302. Call            StartAvSyncMgrNT
  303. Call            StartAvSyncMgr9X
  304. Call            CopySdatPackFile
  305.  
  306. [VirusScanEnterprise]
  307. FindRegKey          HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion
  308. GetRegValue            Ver = HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion, szProductVer
  309. ContinueIf            VScanEnterpriseProd700Check
  310. GetRegValue            szProdDir = HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion, szInstallDir
  311. Call                VirusScan700AndLater
  312.  
  313. [VScanEnterpriseProd700Check]
  314. Return                FirstVSEVersion <= Ver
  315.  
  316. [VirusScan700AndLater]
  317. Call                UpdateVSE700DATs
  318. SetWorkDir            szProdDir
  319. Call                UpdateSVEEngineFiles
  320. SetWorkDir            szProdDir
  321. Call                CopySdatPackFile
  322.  
  323. [UpdateVSE700DATs]
  324. GetProductInfo        szDATDir = DAT, Location, STRING
  325. SetWorkDir            szDATDir
  326. Call                VirusScanEnterpriseDATUpdate
  327. ContinueIf            CheckProductUpdated
  328. SetProductInfo        bOK = DAT, Version, NTDatVersion, STRING
  329. SetProductInfo        bOK = DAT, Date, DatDate, STRING
  330. Call                UpdateCommonDATLocationRegistryValues
  331. NotifyProduct        bNotify = STATE_POSTNOTIFY, DAT, DatVersion
  332. NotifyProduct        bNotify = STATE_SUCCESS, DAT, NTDatVersion
  333.  
  334. [UpdateSVEEngineFiles]
  335. GetProductInfo        szEngDir = Engine, Location, STRING
  336. SetWorkDir            szEngDir
  337. Call                VirusScanEnterpriseEngineUpdate
  338. ContinueIf            CheckProductUpdated
  339. SetProductInfo        bOK = Engine, Version, EngineVersion, STRING
  340. Call                UpdateCommonEngineLocationRegistryValues
  341. NotifyProduct        bNotify = STATE_POSTNOTIFY, Engine, EngineVersion
  342. NotifyProduct        bNotify = STATE_SUCCESS, Engine, NTEngineVersion
  343.  
  344. [VirusScanEnterpriseDATUpdate]
  345. ;Set flag to product upto date
  346. SetFinalStatusFlag    bStatus = 2
  347. ContinueIf            DatUpdateCheckUsingGetProductInfo
  348. ;Set flag to product rejected update
  349. SetFinalStatusFlag    bStatus = 7
  350. ContinueIf            PreNotifyDATUpdate
  351. SetBackupDir        szBackDir = OldDats
  352. ExtractFileSet        SCAN.DAT,NAMES.DAT,CLEAN.DAT
  353. Call                CopyDatFiles
  354. ContinueIf            CheckProductNotUpdated
  355. NotifyProduct        bNotify = STATE_FAIL, DAT, NTDatVersion
  356.  
  357. [DatUpdateCheckUsingGetProductInfo]
  358. GetProductInfo        DatVer = DAT, Version, STRING
  359. Return                DatVer < DatVersion | bForceUpdate == TRUE
  360.  
  361. [PreNotifyDATUpdate]
  362. Call                PreNotifyForceDATUpdate
  363. Call                PreNotifyNoForceDATUpdate
  364. Return                bNotify == 0
  365.  
  366. [PreNotifyForceDATUpdate]
  367. ContinueIf            ForceUpdate
  368. NotifyProduct        bNotify = STATE_PRENOTIFYFORCE, DAT, DatVersion
  369.  
  370. [PreNotifyNoForceDATUpdate]
  371. ContinueIf            NoForceUpdate
  372. NotifyProduct        bNotify = STATE_PRENOTIFY, DAT, DatVersion
  373.  
  374. [VirusScanEnterpriseEngineUpdate]
  375. ContinueIf            EngineUpdateCheckUsingGetProductInfo
  376. ;Set flag to product rejected update
  377. SetFinalStatusFlag    bStatus = 7
  378. ContinueIf            PreNotifyEngineUpdate
  379. SetWorkDir            szEngDir
  380. SetBackupDir        szBackDir = OldEngine
  381. ExtractFileSet        MCSCAN32.DLL
  382. Call                CopyEngineFiles
  383. Call                CopyExtraEngineFiles
  384. Call                CopyPsapiDLL
  385. SetWorkDir            szEngDir
  386. Call                FullVirusScanEnterprise
  387. ContinueIf            CheckProductNotUpdated
  388. NotifyProduct        bNotify = STATE_FAIL, Engine, NTEngineVersion
  389.  
  390. [EngineUpdateCheckUsingGetProductInfo]
  391. GetProductInfo        EngVer = Engine, Version, STRING
  392. Return              EngVer < NTEngineVersion | bForceUpdate == TRUE
  393.  
  394. [PreNotifyEngineUpdate]
  395. Call                PreNotifyForceEngineUpdate
  396. Call                PreNotifyNoForceEngineUpdate
  397. Return                bNotify == 0
  398.  
  399. [PreNotifyForceEngineUpdate]
  400. ContinueIf            ForceUpdate
  401. NotifyProduct        bNotify = STATE_PRENOTIFYFORCE, Engine, EngineVersion
  402.  
  403. [PreNotifyNoForceEngineUpdate]
  404. ContinueIf            NoForceUpdate
  405. NotifyProduct        bNotify = STATE_PRENOTIFY, Engine, EngineVersion
  406.  
  407. [FullVirusScanEnterprise]
  408. Set                    FilterOption = CMNDLINE_FILES
  409. ContinueIf            ValidFilterOptions
  410. InstallFiles        CommandLineSection
  411. Call                FindViruFile
  412. Call                EngineDats
  413.  
  414. [CheckAvSynch9xRunning]
  415. ContinueIf        PlatformWin32_9XCheck
  416. IsAppRunning    bAvSynch = VirusScanSynchMgrClass
  417.  
  418. [CheckAvSynchNTRunning]
  419. ContinueIf        PlatformWin32_NTCheck
  420. IsServiceRunning    bAvSynch = Avsynmgr
  421.  
  422. [VScanDatUpdate]
  423. ContinueIf        DatUpdateCheck
  424. SetBackupDir    szBackDir = OldDats
  425. ExtractFileSet    SCAN.DAT,NAMES.DAT,CLEAN.DAT
  426. Call            StopAvSyncMgrNT
  427. Call            StopAvSyncMgr9X
  428. Call                 CopyDatFiles
  429. Call                UpdateCommonDATLocationRegistryValues
  430. ContinueIf        ProdIsNotVTC
  431. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\VirusScan\AVConsol\General,bDisableRunStartup=TRUE
  432. SetWorkDir        szProdDir
  433. InstallFiles    InterNetDAT
  434.  
  435. [VScanEngineUpdate]
  436. ContinueIf        VScanEngineUpdateCheck
  437. SetWorkDir        szEngDir
  438. SetBackupDir    szBackDir = OldEngine
  439. ExtractFileSet    MCSCAN32.DLL
  440. Call            StopAvSyncMgrNT
  441. Call            StopAvSyncMgr9X
  442. Call                CopyEngineFiles
  443. Call            CopyExtraEngineFiles
  444. Call            CopyPsapiDLL
  445. SetWorkDir        szEngDir
  446. Call            UpdateCommonEngineLocationRegistryValues
  447. Call            FullVScanOnly
  448. ContinueIf        PlatformWin32_9XCheck
  449. SetBackupDir    szBackDir = OldVxds
  450. GetSystemDir    szSysDir
  451. SetWorkDir           szSysDir
  452. InstallFiles    VXD450Section
  453.  
  454. [VScanEngineUpdateCheck]
  455. GetRegValue          EngVer = HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx, szEngineVer
  456. return               EngVer < NTEngineVersion | bForceUpdate == TRUE
  457.  
  458. [FullVScanOnly]
  459. ContinueIf        ProdIsNotVTC
  460. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\VirusScan\AVConsol\General,bDisableRunStartup=TRUE
  461. Set            FilterOption = CMNDLINE_FILES
  462. ContinueIf        ValidFilterOptions
  463. InstallFiles        CommandLineSection
  464. Call            FindViruFile
  465. Call            EngineDats
  466.  
  467. [StopAvSyncMgr9X]
  468. ContinueIf        PlatformWin32_9XCheck
  469. CloseNaiApps    VirusScanSynchMgrClass
  470. WaitTillUnlocked    MCSCAN32.DLL, 30000
  471.  
  472. [StopAvSyncMgrNT]
  473. ContinueIf        PlatformWin32_NTCheck
  474. ContinueIf        AvSyncMgrWasRunning
  475. ContinueIf        ServiceShouldBeDisabled
  476. DisableNaiServices    Avsynmgr
  477. WaitTillUnlocked    MCSCAN32.DLL, 30000
  478. Set            bServiceEnabled = FALSE
  479.  
  480. [StartAvSyncMgr9X]
  481. ContinueIf        PlatformWin32_9XCheck
  482. ContinueIf        AvSyncMgrWasRunning
  483. ContinueIf        AvSyncMgrIsNotRunning
  484. StartNaiApps    Avsynmgr.exe
  485.  
  486. [StartAvSyncMgrNT]
  487. ContinueIf        PlatformWin32_NTCheck
  488. ContinueIf        AvSyncMgrWasRunning
  489. ContinueIf        ServiceShouldBeEnabled
  490. EnableNaiServices    Avsynmgr
  491. WaitForTime        2000
  492. Set            bServiceEnabled = TRUE
  493.  
  494. [AvSyncMgrWasRunning]
  495. return        bAvSynch == TRUE
  496.  
  497. [AvSyncMgrIsNotRunning]
  498. IsAppRunning    bAvSynch = VirusScanSynchMgrClass
  499. return        bAvSynch == FALSE
  500.  
  501. [ProdIsNotVTC]
  502. return        bTC == FALSE
  503. ;-------------------------- Vscan NT ----------------------------------
  504. [FindVirusScanNT]
  505. ContinueIf        PlatformWin32_NTCheck
  506. ContinueIf        ProcessorX86_Check
  507. FindRegKey           HKLM\SOFTWARE\Network Associates\VirusScan NT
  508. Call            NTProductUpdate
  509.  
  510. [FindVirusScanNTSoly]
  511. ContinueIf        PlatformWin32_NTCheck
  512. ContinueIf        ProcessorX86_Check
  513. FindRegKey           HKLM\SOFTWARE\Network Associates\Dr Solomon's VirusScan NT
  514. Call            NTProductUpdate
  515. ;-------------------------- NetShield NT -------------------------------
  516. [FindNetShieldNT]
  517. ContinueIf        PlatformWin32_NTCheck
  518. ContinueIf        ProcessorX86_Check
  519. FindRegKey           HKLM\SOFTWARE\Network Associates\NetShield NT
  520. Call            NTProductUpdate
  521.  
  522. [FindNetShieldNTSoly]
  523. ContinueIf        PlatformWin32_NTCheck
  524. ContinueIf        ProcessorX86_Check
  525. FindRegKey           HKLM\SOFTWARE\Network Associates\Dr Solomon's NetShield NT
  526. Call            NTProductUpdate
  527. ;-------------------------- NetShield NT 4.5.0------------------------------
  528. [FindNetShield450AndLater]
  529. ContinueIf        PlatformWin32_NTCheck
  530. ContinueIf        ProcessorX86_Check
  531. FindRegKey           HKLM\SOFTWARE\Network Associates\TVD\NetShield NT
  532. ContinueIf        NT450ProdCheck
  533. ;Set flag to product upto date
  534. SetFinalStatusFlag    bStatus = 2
  535. IsServiceRunning    bMcTaskMgr = McTaskManager
  536. IsServiceRunning    bMcShield = McShield
  537. Set            bServiceEnabled = TRUE
  538. GetRegValue          szDir=HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx , szInstallDir
  539. SetWorkDir           szDir
  540. Call            NT450DatUpdate
  541. Call            NT450EngineUpdate
  542. GetRegValue        szDir = HKLM\SOFTWARE\Network Associates\TVD\NetShield NT\CurrentVersion, szInstallDir
  543. SetWorkDir           szDir
  544. Call            NTRestartApps
  545. Call            CopySdatPackFile
  546.  
  547. [NT450ProdCheck]
  548. GetRegValue        Ver = HKLM\SOFTWARE\Network Associates\TVD\NetShield NT\CurrentVersion, szProductVer
  549. return        FirstProductVersion <= Ver
  550.  
  551. [NT450DatUpdate]
  552. ContinueIf           DatUpdateCheck
  553. Call            NTNewDatUpdate
  554. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\NetShield NT\CurrentVersion, szVirDefDate = NTDatDate
  555. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\NetShield NT\CurrentVersion, szVirDefVer = NTDatVersion
  556. Call                UpdateCommonDATLocationRegistryValues
  557. Call            EnableMcShieldService
  558.  
  559. [NT450EngineUpdate]
  560. ContinueIf           NTEngine450UpdateCheck
  561. Call            NTCommonEngineUpdate
  562. SetRegValue          HKLM\SOFTWARE\Network Associates\TVD\NetShield NT\CurrentVersion, szEngineVer = EngineVersion
  563. Call                UpdateCommonEngineLocationRegistryValues
  564. Set            FilterOption = CMNDLINE_FILES
  565. ContinueIf        ValidFilterOptions
  566. InstallFiles        CommandLineSection
  567. Call            FindViruFile
  568. Call            EngineDats
  569.  
  570. [NTEngine450UpdateCheck]
  571. GetRegValue          EngVer = HKLM\SOFTWARE\Network Associates\TVD\NetShield NT\CurrentVersion , szEngineVer
  572. return               EngVer < NTEngineVersion | bForceUpdate == TRUE
  573. ;----------NT Common------------------------------------------
  574. [NTProductUpdate]
  575. ContinueIf        NTProd4XCheck
  576. ;Set flag to product upto date
  577. SetFinalStatusFlag    bStatus = 2
  578. IsServiceRunning    bMcTaskMgr = McTaskManager
  579. IsServiceRunning    bMcShield = McShield
  580. Set            bServiceEnabled = TRUE
  581. GetRegValue          szDir = HKLM\SOFTWARE\McAfee\VirusScan , szInstallDir
  582. SetWorkDir           szDir
  583. Call            NTDatUpdate
  584. Call            NTEngineUpdate
  585. Call            NTRestartApps
  586. Call            CopySdatPackFile
  587.  
  588. [NTProd4XCheck]
  589. GetRegValue        Ver = HKLM\SOFTWARE\McAfee\VirusScan , szProductVer
  590. return        FirstProductVersion <= Ver
  591.  
  592. [NTDatUpdate]
  593. ContinueIf           DatUpdateCheck
  594. Call            NTOldDatUpdate
  595. SetRegValue          HKLM\SOFTWARE\McAfee\VirusScan, szVirDefDate = NTDatDate
  596. SetRegValue          HKLM\SOFTWARE\McAfee\VirusScan, szVirDefVer = NTDatVersion
  597. Call                UpdateCommonDATLocationRegistryValues
  598. Call            EnableMcShieldService
  599.  
  600. [NTEngineUpdate]
  601. ContinueIf           EngineUpdateCheck
  602. Call            NTCommonEngineUpdate
  603. Call            EngineDats
  604. SetRegValue          HKLM\SOFTWARE\McAfee\VirusScan, szEngineVer = EngineVersion
  605. Call                UpdateCommonEngineLocationRegistryValues
  606.  
  607. ; This two functions are what were NTCommonDatUpdate.
  608. ; To work around 402 problems and 402->4.5 upgrade problems
  609. ; they need to be seperate.  New can only be called from a
  610. ; 4.5 product.
  611. ; Old can only be called if 402 or 403 is present.  
  612. [NTNewDatUpdate]
  613. SetBackupDir    szBackDir = OldDats
  614. ExtractFileSet    SCAN.DAT, NAMES.DAT, CLEAN.DAT
  615. Call            DisableMcShieldService
  616. Call            CheckToStopMcShield
  617. Call            CopyDatFiles
  618.  
  619. [NTOldDatUpdate]
  620. SetBackupDir    szBackDir = OldDats
  621. ExtractFileSet    SCAN.DAT, NAMES.DAT, CLEAN.DAT
  622. Call            DisableMcShieldService
  623. Call            CheckToStopMcShield
  624. Call            CheckToStopMcShield402
  625. Call            CopyDatFiles
  626.  
  627.  
  628.  
  629. [NTCommonEngineUpdate]
  630. SetBackupDir        szBackDir = OldEngine
  631. ExtractFileSet        MCSCAN32.DLL
  632. CloseNaiApps        VirusScan
  633. StopNaiServices        McShield, McTaskManager
  634. Call                CopyEngineFiles
  635. Call            CopyExtraEngineFiles
  636. Call            CopyPsapiDLL
  637. SetWorkDir           szDir
  638.  
  639. [NTRestartApps]
  640. Call            CheckMcTaskManager
  641. Call            CheckMcShield
  642.  
  643. [CheckMcTaskManager]
  644. ContinueIf        McTaskManagerWasRunning
  645. StartNaiServices    McTaskManager
  646.  
  647. [McTaskManagerWasRunning]
  648. return        bMcTaskMgr == TRUE
  649.  
  650. [CheckMcShield]
  651. ContinueIf        McShieldWasRunning
  652. StartNaiServices    McShield
  653.  
  654. [McShieldWasRunning]
  655. return        bMcShield == TRUE
  656.  
  657. [CheckToStopMcShield]
  658. IsFileLocked    bLocked = SCAN.DAT
  659. ContinueIf        StopMcShieldCheck
  660. Call            EnableMcShieldService
  661. StopNaiServices    McShield, McTaskManager
  662.  
  663. [StopMcShieldCheck]
  664. return        bLocked == TRUE
  665.  
  666.  
  667. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  668. ; Treat 402 as a special case.
  669. ; This key,  with "VirusScan" in it is present in VS402 and NS402
  670. [CheckToStopMcShield402]
  671.  
  672. FindRegKey      HKLM\SOFTWARE\McAfee\VirusScan
  673. GetRegValue        402Ver = HKLM\SOFTWARE\McAfee\VirusScan , szProductVer
  674. ContinueIf        Is402
  675. Call            EnableMcShieldService
  676. StopNaiServices    McShield, McTaskManager
  677.  
  678. [Is402]
  679. return          402Ver == 4.0.2
  680. ; Treat 402 as a special case.
  681. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  682.  
  683.  
  684.  
  685. [DisableMcShieldService]
  686. CloseNaiApps    VirusScan
  687. ContinueIf        McShieldWasRunning
  688. ContinueIf        ServiceShouldBeDisabled
  689. DisableNaiServices    McShield
  690. WaitTillUnlocked    SCAN.DAT, 15000
  691. Set            bServiceEnabled = FALSE
  692.  
  693. [EnableMcShieldService]
  694. ContinueIf        McShieldWasRunning
  695. ContinueIf        ServiceShouldBeEnabled
  696. EnableNaiServices    McShield
  697. WaitForTime        2000
  698. Set            bServiceEnabled = TRUE
  699.  
  700. [ServiceShouldBeDisabled]
  701. return        bServiceEnabled == TRUE
  702.  
  703. [ServiceShouldBeEnabled]
  704. return        bServiceEnabled == FALSE
  705.  
  706. ;------------------------------- GroupShield Exchange -------------------------
  707. [FindGroupShieldExchange]
  708. ContinueIf            PlatformWin32_NTCheck
  709. ContinueIf            ProcessorX86_Check
  710. Call                GroupShieldExchangePre600
  711. Call                GroupShieldExchange600AndLater
  712.  
  713. [GroupShieldExchangePre600]
  714. FindRegKey           HKLM\SOFTWARE\Network Associates\GroupShield Exchange
  715. FindRegKey            HKLM\SYSTEM\CurrentControlSet\Services\AVExch32Service
  716. GetRegValue            szProdDir = HKLM\SYSTEM\CurrentControlSet\Services\AVExch32Service, ImagePath
  717. NameStripFile        szProdDir
  718. SetWorkDir            szProdDir
  719. ContinueIf            4XVersionCheck
  720. SetFinalStatusFlag    bStatus = 2
  721. Call                GSEDATUpdate
  722. Call                GSEEngineUpdate
  723. StartGSE
  724. Call                CopySdatPackFile
  725.  
  726. [GSEDATUpdate]
  727. ContinueIf            DatUpdateCheck
  728. SetBackupDir        szBackDir = OldDats
  729. ExtractFileSet        SCAN.DAT, NAMES.DAT, CLEAN.DAT
  730. StopGSE
  731. Call                CopyDatFiles
  732.  
  733. [GSEEngineUpdate]
  734. ContinueIf            Engine32OldCheck
  735. SetBackupDir        szBackDir = OldEngine
  736. ExtractFileSet        MCSCAN32.DLL, LICENSE.DAT, MESSAGES.DAT
  737. StopGSE
  738. Call                CopyEngineFiles
  739. Call                EngineDats
  740. Call                CopyExtraEngineFiles
  741. Call                CopyPsapiDLL
  742. SetWorkDir            szProdDir
  743.  
  744. [GroupShieldExchange600AndLater]
  745. LoadModule            bComponent = MCAFEEPRODUCT, {5712C245-EB8D-4816-809A-81D78D7E9285}
  746. Call                GroupShield
  747. UnloadModule        bComponent = MCAFEEPRODUCT
  748.  
  749. [GroupShield]
  750. FindRegKey          HKLM\SOFTWARE\Network Associates\McAfee GroupShield\SystemState
  751. GetRegValue            Ver = HKLM\SOFTWARE\Network Associates\McAfee GroupShield\SystemState, ProductVersion
  752. ContinueIf            GroupShieldProdCheck
  753. FindRegKey          HKLM\SOFTWARE\Network Associates\McAfee GroupShield
  754. GetRegValue            szProdDir = HKLM\SOFTWARE\Network Associates\McAfee GroupShield, InstallPath
  755. Call                GroupShield600AndLater
  756.  
  757. [GroupShieldProdCheck]
  758. Return                FirstGSEVersion <= Ver
  759.  
  760. [GroupShield600AndLater]
  761. Call                UpdateGSE600DATs
  762. SetWorkDir            szProdDir
  763. Call                UpdateGSEEngineFiles
  764. SetWorkDir            szProdDir
  765. SetBackupDir        szBackDir = OldPkLst
  766. Call                CopySdatPackFile
  767.  
  768. [UpdateGSE600DATs]
  769. Set                    bSectionUpdated = FALSE
  770. Call                GroupShieldDATUpdate
  771. ContinueIf            CheckProductUpdated
  772. ContinueIf            CheckSectionUpdated
  773. SetProductInfo        bOK = DAT, Version, DatVersion, STRING
  774. SetProductInfo        bOK = DAT, Date, DatDate, STRING
  775. NotifyProduct        bNotify = STATE_POSTNOTIFY, DAT, DatVersion
  776. NotifyProduct        bNotify = STATE_SUCCESS, DAT, NTDatVersion
  777.  
  778. [GroupShieldDATUpdate]
  779. ;Set flag to product upto date
  780. SetFinalStatusFlag    bStatus = 2
  781. ContinueIf            DatUpdateCheckUsingGetProductInfo
  782. ;Set flag to product rejected update
  783. SetFinalStatusFlag    bStatus = 7
  784. ContinueIf            PreNotifyDATUpdate
  785. GetProductInfo        szDATDir = DAT, Location, STRING
  786. SetWorkDir            szDATDir, CREATE
  787. ExtractFileSet        SCAN.DAT,NAMES.DAT,CLEAN.DAT
  788. Call                CopyDatFiles
  789. ContinueIf            CheckProductNotUpdated
  790. NotifyProduct        bNotify = STATE_FAIL, DAT, NTDatVersion
  791.  
  792. [UpdateGSEEngineFiles]
  793. Set                    bSectionUpdated = FALSE
  794. Call                GroupShieldEngineUpdate
  795. ContinueIf            CheckProductUpdated
  796. ContinueIf            CheckSectionUpdated
  797. SetProductInfo        bNotify = Engine, Version, EngineVersion, STRING
  798. NotifyProduct        bNotify = STATE_POSTNOTIFY, Engine, EngineVersion
  799. NotifyProduct        bNotify = STATE_SUCCESS, Engine, NTEngineVersion
  800.  
  801. [GroupShieldEngineUpdate]
  802. ContinueIf            EngineUpdateCheckUsingGetProductInfo
  803. ;Set flag to product rejected update
  804. SetFinalStatusFlag    bStatus = 7
  805. ContinueIf            PreNotifyEngineUpdate
  806. GetProductInfo        szEngDir = Engine, Location, STRING
  807. SetWorkDir            szEngDir, CREATE
  808. ExtractFileSet        MCSCAN32.DLL, SIGNLIC.TXT, LICENSE.DAT, MESSAGES.DAT
  809. Call                CopyEngineFiles
  810. Call                EngineDats
  811. ContinueIf            CheckProductNotUpdated
  812. NotifyProduct        bNotify = STATE_FAIL, Engine, NTEngineVersion
  813.  
  814. ;------------------------------ WebShield SMTP --------------------------------
  815. [FindWebShieldSMTP]
  816. ContinueIf         PlatformWin32_NTCheck
  817. ContinueIf        ProcessorX86_Check
  818. FindRegKey           HKLM\SOFTWARE\Network Associates\WebShield SMTP
  819. ContinueIf        WShSMTPProd4XCheck
  820. GetRegValue          szDir = HKLM\SOFTWARE\McAfee\WebShield SMTP\Mail Scan , Install_Path
  821. SetWorkDir        szDir
  822. IsServiceRunning    bMailCfg = mailcfg
  823. IsServiceRunning    bMailScan = mailscan
  824. SetFinalStatusFlag    bStatus = 2
  825. Call                 WebShieldDATUpdate
  826. Call                 WebShieldEngineUpdate
  827. Call            WshStartServices
  828. Call            CopySdatPackFile
  829.  
  830. [WShSMTPProd4XCheck]
  831. FindRegKey        HKLM\SOFTWARE\McAfee\WebShield SMTP
  832. GetRegValue        Ver = HKLM\SOFTWARE\McAfee\WebShield SMTP, szMailScanVer
  833. return            FirstProductVersion <= Ver
  834.  
  835. [WebShieldDATUpdate]
  836. ContinueIf        DatUpdateCheck
  837. SetBackupDir        szBackDir = OldDats
  838. ExtractFileSet        SCAN.DAT, NAMES.DAT, CLEAN.DAT
  839. StopNaiServices        mailcfg, mailscan
  840. Call                CopyDatFiles
  841. SetRegValue        HKLM\SOFTWARE\McAfee\WebShield SMTP, szVirDefDate = DatDate
  842. SetRegValue        HKLM\SOFTWARE\McAfee\WebShield SMTP, szVirDefVer = DatVersion
  843.  
  844. [WebShieldEngineUpdate]
  845. ContinueIf        WebShieldEngineUpdateCheck
  846. SetBackupDir        szBackDir = OldEngine
  847. ExtractFileSet        MCSCAN32.DLL, LICENSE.DAT, MESSAGES.DAT
  848. StopNaiServices        mailcfg, mailscan
  849. Call                CopyEngineFiles
  850. Call            EngineDats
  851. Call            CopyExtraEngineFiles
  852. Call            CopyPsapiDLL
  853. SetWorkDir        szDir
  854. SetRegValue        HKLM\SOFTWARE\McAfee\WebShield SMTP, szEngineVer = EngineVersion
  855.  
  856.  
  857. [WebShieldEngineUpdateCheck]
  858. GetRegValue          EngVer = HKLM\SOFTWARE\McAfee\WebShield SMTP, szEngineVer
  859. return               EngVer < NTEngineVersion | bForceUpdate == TRUE
  860.  
  861. [WshStartServices]
  862. Call            MailScanService
  863. Call            MailCfgService
  864.  
  865. [MailScanService]
  866. ContinueIf        WshMailScanStartCheck
  867. StartNaiServices    mailscan
  868.  
  869. [MailCfgService]
  870. ContinueIf        WshMailCfgStartCheck
  871. StartNaiServices    mailcfg
  872. ;--------------------------- WebShield SMTP 4.5.0----------------------
  873. [FindWebShieldSMTP450AndLater]
  874. ContinueIf         PlatformWin32_NTCheck
  875. ContinueIf        ProcessorX86_Check
  876. FindRegKey           HKLM\SOFTWARE\Network Associates\TVD\WebShield SMTP
  877. GetRegValue          szDir = HKLM\SOFTWARE\Network Associates\TVD\WebShield SMTP\MailScan, Install_Path
  878. SetWorkDir        szDir
  879. ContinueIf        4XVersionCheck
  880. IsServiceRunning    bMailCfg = WebShield SMTP MailCfg
  881. IsServiceRunning    bMailScan = WebShield SMTP MailScan
  882. SetFinalStatusFlag    bStatus = 2
  883. Call                 WebShield450DATUpdate
  884. Call                 WebShield450EngineUpdate
  885. Call            Wsh450StartServices
  886. Call            CopySdatPackFile
  887.  
  888. [WebShield450DATUpdate]
  889. ContinueIf        DatUpdateCheck
  890. SetBackupDir        szBackDir = OldDats
  891. ExtractFileSet        SCAN.DAT, NAMES.DAT, CLEAN.DAT
  892. StopNaiServices        WebShield SMTP MailCfg, WebShield SMTP MailScan
  893. Call                CopyDatFiles
  894. SetRegValue        HKLM\SOFTWARE\Network Associates\TVD\WebShield SMTP, szVirDefDate = DatDate
  895. SetRegValue        HKLM\SOFTWARE\Network Associates\TVD\WebShield SMTP, szVirDefVer = NTDatVersion
  896.  
  897. [WebShield450EngineUpdate]
  898. ContinueIf        WebShield450EngineUpdateCheck
  899. SetBackupDir        szBackDir = OldEngine
  900. ExtractFileSet        MCSCAN32.DLL, LICENSE.DAT, MESSAGES.DAT
  901. StopNaiServices        WebShield SMTP MailCfg, WebShield SMTP MailScan
  902. Call                CopyEngineFiles
  903. Call            EngineDats
  904. Call            CopyExtraEngineFiles
  905. Call            CopyPsapiDLL
  906. SetWorkDir        szDir
  907. SetRegValue        HKLM\SOFTWARE\Network Associates\TVD\WebShield SMTP, szEngineVer = EngineVersion
  908.  
  909.  
  910. [WebShield450EngineUpdateCheck]
  911. GetRegValue          EngVer = HKLM\SOFTWARE\Network Associates\TVD\WebShield SMTP, szEngineVer
  912. return               EngVer < NTEngineVersion | bForceUpdate == TRUE
  913.  
  914. [Wsh450StartServices]
  915. Call            Wsh450MailScanService
  916. Call            Wsh450MailCfgService
  917.  
  918. [Wsh450MailScanService]
  919. ContinueIf        WshMailScanStartCheck
  920. StartNaiServices    WebShield SMTP MailScan
  921.  
  922. [Wsh450MailCfgService]
  923. ContinueIf        WshMailCfgStartCheck
  924. StartNaiServices    WebShield SMTP MailCfg
  925. ;-------------------------- WebShield SMTP Common----------------------
  926. [WshMailScanStartCheck]
  927. return            bMailScan == TRUE
  928.  
  929. [WshMailCfgStartCheck]
  930. return            bMailCfg == TRUE
  931.  
  932. ;-----------------------------------GroupShieldDomino-----------------------
  933. [FindGroupShieldDomino]
  934. ContinueIf         PlatformWin32_NTCheck
  935. ContinueIf        ProcessorX86_Check
  936. FindAndInitGSD
  937. GetGSDInfo          bUpdateGSD=GSD_UPDATE_OK
  938. ContinueIf            OKToUpdateGSD
  939. GetGSDInfo          szGSDEngVer=GSD_ENG_VER
  940. GetGSDInfo          szGSDProdVer=GSD_PROD_VER
  941. GetGSDInfo          szGSDDatEngLoc=GSD_ENG_LOC
  942. GetGSDInfo          szGSDProdLoc=GSD_PROD_LOC
  943. ContinueIf        MinimumVersionCheck
  944. SetWorkDir        szGSDDatEngLoc
  945. SetFinalStatusFlag    bStatus = 2
  946. call            UpdateGroupShieldDats
  947. call            UpdateGroupShieldEng
  948. StartGSD
  949. DeInitGSD
  950. SetWorkDir        szGSDProdLoc
  951. Call            CopySdatPackFile
  952.  
  953. [OKToUpdateGSD]
  954. Return            bUpdateGSD == 0
  955.  
  956. [MinimumVersionCheck]
  957. return            szGSDProdVer >= FirstGSDVersion
  958.  
  959. [UpdateGroupShieldDats]
  960. ContinueIf        DatUpdateCheck
  961. ExtractFileSet        SCAN.DAT, NAMES.DAT, CLEAN.DAT
  962. StopGSD
  963. SetBackupDir        szBackDir = OldDats
  964. Call                CopyDatFiles
  965. SetGSDInfo         GSD_DAT_VER=NTDatVersion
  966.  
  967. [UpdateGroupShieldEng]
  968. ContinueIf        GSDEngUpdateCheck
  969. ExtractFileSet        MCSCAN32.DLL
  970. StopGSD
  971. SetBackupDir        szBackDir = OldEngine
  972. Call                CopyEngineFiles
  973. Call            EngineDats
  974. Call            CopyExtraEngineFiles
  975. Call            CopyPsapiDLL
  976. SetGSDInfo         GSD_ENG_VER=EngineVersion
  977.  
  978. [GSDEngUpdateCheck]
  979. return               szGSDEngVer < NTEngineVersion | bForceUpdate == TRUE
  980.  
  981. ;-----------------------------------PortalShield-----------------------
  982. [FindPortalShield]
  983. ContinueIf            PlatformWin32_NTCheck
  984. ContinueIf            ProcessorX86_Check
  985. LoadModule            bComponent = MCAFEEPRODUCT, {940F2A91-D23C-4BE3-8BD7-FBB5DC20BFF0}
  986. Call                PortalShield
  987. UnloadModule        bComponent = MCAFEEPRODUCT
  988.  
  989. [PortalShield]
  990. FindRegKey          HKLM\SOFTWARE\Network Associates\McAfee PortalShield\SystemState
  991. GetRegValue            Ver = HKLM\SOFTWARE\Network Associates\McAfee PortalShield\SystemState, ProductVersion
  992. ContinueIf            PortalShieldProdCheck
  993. FindRegKey          HKLM\SOFTWARE\Network Associates\McAfee PortalShield
  994. GetRegValue            szProdDir = HKLM\SOFTWARE\Network Associates\McAfee PortalShield, InstallPath
  995. Call                PortalShield100AndLater
  996.  
  997. [PortalShieldProdCheck]
  998. Return                FirstPSHVersion <= Ver
  999.  
  1000. [PortalShield100AndLater]
  1001. Call                UpdatePSH100DATs
  1002. SetWorkDir            szProdDir
  1003. Call                UpdatePSHEngineFiles
  1004. SetWorkDir            szProdDir
  1005. SetBackupDir        szBackDir = OldPkLst
  1006. Call                CopySdatPackFile
  1007.  
  1008. [UpdatePSH100DATs]
  1009. Set                    bSectionUpdated = FALSE
  1010. Call                PortalShieldDATUpdate
  1011. ContinueIf            CheckProductUpdated
  1012. ContinueIf            CheckSectionUpdated
  1013. SetProductInfo        bOK = DAT, Version, DatVersion, STRING
  1014. SetProductInfo        bOK = DAT, Date, DatDate, STRING
  1015. NotifyProduct        bNotify = STATE_POSTNOTIFY, DAT, DatVersion
  1016. NotifyProduct        bNotify = STATE_SUCCESS, DAT, NTDatVersion
  1017.  
  1018. [PortalShieldDATUpdate]
  1019. ;Set flag to product upto date
  1020. SetFinalStatusFlag    bStatus = 2
  1021. ContinueIf            DatUpdateCheckUsingGetProductInfo
  1022. ;Set flag to product rejected update
  1023. SetFinalStatusFlag    bStatus = 7
  1024. ContinueIf            PreNotifyDATUpdate
  1025. GetProductInfo        szDATDir = DAT, Location, STRING
  1026. SetWorkDir            szDATDir, CREATE
  1027. ExtractFileSet        SCAN.DAT,NAMES.DAT,CLEAN.DAT
  1028. Call                CopyDatFiles
  1029. ContinueIf            CheckProductNotUpdated
  1030. NotifyProduct        bNotify = STATE_FAIL, DAT, NTDatVersion
  1031.  
  1032. [UpdatePSHEngineFiles]
  1033. Set                    bSectionUpdated = FALSE
  1034. Call                PortalShieldEngineUpdate
  1035. ContinueIf            CheckProductUpdated
  1036. ContinueIf            CheckSectionUpdated
  1037. SetProductInfo        bNotify = Engine, Version, EngineVersion, STRING
  1038. NotifyProduct        bNotify = STATE_POSTNOTIFY, Engine, EngineVersion
  1039. NotifyProduct        bNotify = STATE_SUCCESS, Engine, NTEngineVersion
  1040.  
  1041. [PortalShieldEngineUpdate]
  1042. ContinueIf            EngineUpdateCheckUsingGetProductInfo
  1043. ;Set flag to product rejected update
  1044. SetFinalStatusFlag    bStatus = 7
  1045. ContinueIf            PreNotifyEngineUpdate
  1046. GetProductInfo        szEngDir = Engine, Location, STRING
  1047. SetWorkDir            szEngDir, CREATE
  1048. ExtractFileSet        MCSCAN32.DLL, SIGNLIC.TXT, LICENSE.DAT, MESSAGES.DAT
  1049. Call                CopyEngineFiles
  1050. Call                EngineDats
  1051. ContinueIf            CheckProductNotUpdated
  1052. NotifyProduct        bNotify = STATE_FAIL, Engine, NTEngineVersion
  1053.  
  1054. ;-----------------------------------SecurityShield-----------------------
  1055. [FindSecurityShield]
  1056. ContinueIf            PlatformWin32_NTCheck
  1057. ContinueIf            ProcessorX86_Check
  1058. LoadModule            bComponent = MCAFEEPRODUCT, {08446D7B-D44B-49b0-B676-1E433B17F3B8}
  1059. Call                SecurityShield
  1060. UnloadModule        bComponent = MCAFEEPRODUCT
  1061.  
  1062. [SecurityShield]
  1063. FindRegKey          HKLM\SOFTWARE\Network Associates\McAfee SecurityShield for Microsoft ISA Server\SystemState
  1064. GetRegValue            Ver = HKLM\SOFTWARE\Network Associates\McAfee SecurityShield for Microsoft ISA Server\SystemState, ProductVersion
  1065. ContinueIf            SecurityShieldProdCheck
  1066. FindRegKey          HKLM\SOFTWARE\Network Associates\McAfee SecurityShield for Microsoft ISA Server
  1067. GetRegValue            szProdDir = HKLM\SOFTWARE\Network Associates\McAfee SecurityShield for Microsoft ISA Server, InstallPath
  1068. Call                SecurityShield100AndLater
  1069.  
  1070. [SecurityShieldProdCheck]
  1071. Return                FirstSSHVersion <= Ver
  1072.  
  1073. [SecurityShield100AndLater]
  1074. Call                UpdateSSH100DATs
  1075. SetWorkDir            szProdDir
  1076. Call                UpdateSSHEngineFiles
  1077. SetWorkDir            szProdDir
  1078. SetBackupDir        szBackDir = OldPkLst
  1079. Call                CopySdatPackFile
  1080.  
  1081. [UpdateSSH100DATs]
  1082. Set                    bSectionUpdated = FALSE
  1083. Call                SecurityShieldDATUpdate
  1084. ContinueIf            CheckProductUpdated
  1085. ContinueIf            CheckSectionUpdated
  1086. SetProductInfo        bOK = DAT, Version, DatVersion, STRING
  1087. SetProductInfo        bOK = DAT, Date, DatDate, STRING
  1088. NotifyProduct        bNotify = STATE_POSTNOTIFY, DAT, DatVersion
  1089. NotifyProduct        bNotify = STATE_SUCCESS, DAT, NTDatVersion
  1090.  
  1091. [SecurityShieldDATUpdate]
  1092. ;Set flag to product upto date
  1093. SetFinalStatusFlag    bStatus = 2
  1094. ContinueIf            DatUpdateCheckUsingGetProductInfo
  1095. ;Set flag to product rejected update
  1096. SetFinalStatusFlag    bStatus = 7
  1097. ContinueIf            PreNotifyDATUpdate
  1098. GetProductInfo        szDATDir = DAT, Location, STRING
  1099. SetWorkDir            szDATDir, CREATE
  1100. ExtractFileSet        SCAN.DAT,NAMES.DAT,CLEAN.DAT
  1101. Call                CopyDatFiles
  1102. ContinueIf            CheckProductNotUpdated
  1103. NotifyProduct        bNotify = STATE_FAIL, DAT, NTDatVersion
  1104.  
  1105. [UpdateSSHEngineFiles]
  1106. Set                    bSectionUpdated = FALSE
  1107. Call                SecurityShieldEngineUpdate
  1108. ContinueIf            CheckProductUpdated
  1109. ContinueIf            CheckSectionUpdated
  1110. SetProductInfo        bNotify = Engine, Version, EngineVersion, STRING
  1111. NotifyProduct        bNotify = STATE_POSTNOTIFY, Engine, EngineVersion
  1112. NotifyProduct        bNotify = STATE_SUCCESS, Engine, NTEngineVersion
  1113.  
  1114. [SecurityShieldEngineUpdate]
  1115. ContinueIf            EngineUpdateCheckUsingGetProductInfo
  1116. ;Set flag to product rejected update
  1117. SetFinalStatusFlag    bStatus = 7
  1118. ContinueIf            PreNotifyEngineUpdate
  1119. GetProductInfo        szEngDir = Engine, Location, STRING
  1120. SetWorkDir            szEngDir, CREATE
  1121. ExtractFileSet        MCSCAN32.DLL, SIGNLIC.TXT, LICENSE.DAT, MESSAGES.DAT
  1122. Call                CopyEngineFiles
  1123. Call                EngineDats
  1124. ContinueIf            CheckProductNotUpdated
  1125. NotifyProduct        bNotify = STATE_FAIL, Engine, NTEngineVersion
  1126.  
  1127. ;--------------------------- Common ----------------------------------
  1128. [ProcessorX86_Check]
  1129. GetProcessorType    szProcessor
  1130. return               szProcessor == PROCESSOR_INTEL
  1131.  
  1132. [PlatformWin32_9XCheck]
  1133. return        szOSType == WIN32_9X
  1134.  
  1135. [PlatformWin32_NTCheck]
  1136. return        szOSType == WIN32_NTS | szOSType == WIN32_NTW
  1137.  
  1138. [PlatformWin32_Check]
  1139. return        szOSType == WIN32_9X | szOSType == WIN32_NTS | szOSType == WIN32_NTW
  1140.  
  1141. [PlatformDOSCheck]
  1142. return        szOSType == WIN16_DOS
  1143.  
  1144. [DatUpdateCheck]
  1145. Get4xDatVersion      DatVer = SCAN.DAT
  1146. return            DatVer < DatVersion | bForceUpdate == TRUE
  1147.  
  1148. [EngineUpdateCheck]
  1149. FindRegKey        HKLM\SOFTWARE\McAfee\VirusScan
  1150. GetRegValue          EngVer = HKLM\SOFTWARE\McAfee\VirusScan , szEngineVer
  1151. return               EngVer < NTEngineVersion | bForceUpdate == TRUE
  1152.  
  1153. [Engine32OldCheck]
  1154. IsCurrentFileOlder    bOlderFile = MCSCAN32.DLL
  1155. return            bOlderFile == TRUE | bForceUpdate == TRUE
  1156.  
  1157. [Engine16OldCheck]
  1158. IsCurrentFileOlder    bOlderFile = MCSCAN16.DLL
  1159. return            bOlderFile == TRUE | bForceUpdate == TRUE
  1160.  
  1161. ;For 4x product Dat version should be >=4002
  1162. [4XVersionCheck]
  1163. Get4xDatVersion      DatVer = SCAN.DAT
  1164. return            DatVer >= TempEngineVer
  1165.  
  1166. [ForceUpdate]
  1167. Return            bForceUpdate == TRUE
  1168.  
  1169. [NoForceUpdate]
  1170. Return            bForceUpdate == FALSE
  1171.  
  1172. [FoundCheck]
  1173. return            bFound == TRUE
  1174.  
  1175. [NotFoundCheck]
  1176. return            bFound == FALSE
  1177.  
  1178. [CopyDatFiles]
  1179. CanAllFilesBeCopied    bDatUpdate = SCAN.DAT, NAMES.DAT, CLEAN.DAT
  1180. InstallFiles        DatSection
  1181. SetFinalStatusFlag    bStatus = 0
  1182. Set                    bSectionUpdated = TRUE
  1183.  
  1184. [CopyEngineFiles]
  1185. CanAllFilesBeCopied    bEngineUpdate = MCSCAN32.DLL
  1186. InstallFiles        Engine32Section
  1187. SetFinalStatusFlag    bStatus = 0
  1188. Set                    bSectionUpdated = TRUE
  1189.  
  1190. [CopyExtraEngineFiles]
  1191. ContinueIf        EngineIs4050OrGreater
  1192. Call            CopyAvparamDLL
  1193. Call            CopyRwabs16DLL
  1194. Call            CopyRwabs32DLL
  1195.  
  1196. [CopyAvparamDLL]
  1197. IsCurrentFileOlder    bOlderFile = AVPARAM.DLL
  1198. ContinueIf            OldFileExists
  1199. IsFileLocked            bLocked = AVPARAM.DLL
  1200. ContinueIf            FileIsNotLocked
  1201. CopyFileAs            AVPARAM.DLL = AVPARAM.DLL
  1202.  
  1203. [CopyRwabs16DLL]
  1204. ContinueIf        PlatformWin32_9XCheck
  1205. IsCurrentFileOlder    bOlderFile = RWABS16.DLL
  1206. ContinueIf            OldFileExists
  1207. CopyFileAs            RWABS16.DLL = RWABS16.DLL
  1208.  
  1209. [CopyRwabs32DLL]
  1210. ContinueIf        PlatformWin32_9XCheck
  1211. IsCurrentFileOlder    bOlderFile = RWABS32.DLL
  1212. ContinueIf            OldFileExists
  1213. CopyFileAs            RWABS32.DLL = RWABS32.DLL
  1214.  
  1215. [CopyPsapiDLL]
  1216. ContinueIf             PlatformWin32_NTCheck
  1217. ContinueIf            EngineIs4050OrGreater
  1218. GetSystemDir        szSysDir
  1219. SetWorkDir            szSysDir
  1220. FileExists            bFound = PSAPI.DLL
  1221. ContinueIf            NotFoundCheck
  1222. CopyFileAs            PSAPI.DLL = PSAPI.DLL
  1223.  
  1224. [OldFileExists]
  1225. return            bOlderFile == TRUE | bForceUpdate == TRUE
  1226.  
  1227. [EngineIs4050OrGreater]
  1228. return    NTEngineVersion >= 4050
  1229.  
  1230. [FileIsNotLocked]
  1231. return        bLocked == FALSE
  1232.  
  1233. [CopyCommandLineFiles]
  1234. InstallFiles        Engine32Section
  1235. InstallFiles        CommandLineSection
  1236. Call            FindViruFile
  1237. SetFinalStatusFlag    bStatus = 0
  1238. Set                    bSectionUpdated = TRUE
  1239.  
  1240. [FindViruFile]
  1241. FileExists        bFound = FINDVIRU.EXE
  1242. ContinueIf        FoundCheck
  1243. InstallFiles        FindViruSection
  1244.  
  1245. [CopySdatPackFile]
  1246. ContinueIf        CheckProductUpdated
  1247. InstallFiles        SdatPackFile
  1248.  
  1249. [CheckProductUpdated]
  1250. return            bStatus == 0
  1251.  
  1252. [CheckProductNotUpdated]
  1253. return            bStatus == 1 | bStatus == 2 | bStatus == 3 | bStatus == 4 | bStatus == 5 | bStatus == 6 | bStatus == 7
  1254.  
  1255. [CheckSectionUpdated]
  1256. Return            bSectionUpdated == TRUE
  1257.  
  1258. [DatSection]
  1259. File        SCAN.DAT
  1260. File        NAMES.DAT
  1261. File        CLEAN.DAT
  1262.  
  1263. [InterNetDAT]
  1264. CopyFileAs    Internet.DAT = Internet.DAT
  1265.  
  1266. [VXD403Section]
  1267. File        MCSCAN32.VXD
  1268. File        VSHIELD.VXD
  1269.  
  1270. [VXD450Section]
  1271. File        MCSCAN32.VXD
  1272.  
  1273. [Engine32Section]
  1274. File        MCSCAN32.DLL
  1275. CopyFileAs    SIGNLIC.TXT = SIGNLIC.TXT
  1276.  
  1277. [EngineDats]
  1278. File        LICENSE.DAT
  1279. File        MESSAGES.DAT
  1280.  
  1281. [CommandLineSection]
  1282. File        SCAN.EXE
  1283. File        SCANPM.EXE
  1284. CopyFileAs    MCTOOL.EXE = MCTOOL.EXE
  1285. CopyFileAs    SIGNLIC.TXT = SIGNLIC.TXT
  1286.  
  1287. [SdatPackFile]
  1288. CopyFileAs    SDATPACK.LST = SDATPACK.LST
  1289.  
  1290. [FindViruSection]
  1291. CopyFileAs    SCAN.EXE = FindViru.EXE
  1292.